<!DOCTYPE html>
<html xmlns:wb="http://open.weibo.com/wb">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
	<meta content="yes" name="apple-mobile-web-app-capable" />
	<meta content="black" name="apple-mobile-web-app-status-bar-style">
	<meta content="telephone=no" name="format-detection" />
	<meta content="emai=no" name="format-detection" />
	<meta property="wb:webmaster" content="7ae117dc1d8992dc" />
	<title>啪啪蚊子大作战</title>
	<link href="/wenzi/css/common.css" rel="stylesheet" />
	<link href="/wenzi/css/game.css" rel="stylesheet" />
	<script src="/wenzi/js/zepto-1.1.6.js"></script>
	<script src="/wenzi/js/fastclick.js"></script>
	<script src="/wenzi/js/common.js"></script>
	<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
</head>
<body>
	<div id="wrapper">
		<button id="test_btn">测试按钮</button>
		<div class="popup-wrapper showTimeout">
			<div class="popup-layout">
				<img src="/wenzi/img/t_3.png" />
				<img src="/wenzi/img/t_2.png" />
				<img src="/wenzi/img/t_1.png" />
				<p><img src="/wenzi/img/txt_rule.png" /></p>
			</div>
		</div>
	</div>
	<script type="text/javascript">
    Zepto(function ($) {
        wx.config({
            debug: false,
            appId: '<?php echo $js_config['appId']?>',
            timestamp: <?php echo $js_config['timestamp']?>,
            nonceStr: '<?php echo $js_config['noncestr']?>',
            signature: '<?php echo $js_config['signature']?>',
            jsApiList: [
            	'onMenuShareTimeline',
            	'onMenuShareAppMessage'
            ]
        });

		//微信默认
        wx.ready(function () {
        	wx.onMenuShareTimeline({
        	    title: '默认分享的标题', // 分享标题
        	    link: 'http://wx.zhishimama.com', // 分享链接
        	    imgUrl: 'http://wx.zhishimama.com/wenzi/img/sharelog.jpeg', // 分享图标
        	    success: function () {
        	        // 用户确认分享后执行的回调函数
        	        $.ajax({
        				url: "/mosquito/share",
        				data: {page_id: 2},
        				type: "post",
        				success: function(res){
        				}
        		    });
        	    },
        	    cancel: function () {
        	        // 用户取消分享后执行的回调函数
        	    }
        	});

        	wx.onMenuShareAppMessage({
        		title: '默认分享的标题', // 分享标题
        	    link: 'http://wx.zhishimama.com', // 分享链接
        	    desc: '默认的desc',
        	    imgUrl: 'http://wx.zhishimama.com/wenzi/img/sharelog.jpeg', // 分享图标
        	    type: 'link', // 分享类型,music、video或link，不填默认为link
        	    dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
        	    success: function () {
        	        // 用户确认分享后执行的回调函数
        	    	$.ajax({
        				url: "/mosquito/share",
        				data: {page_id: 2},
        				type: "post",
        				success: function(res){
        				}
        		    });
        	    },
        	    cancel: function () {
        	        // 用户取消分享后执行的回调函数
        	    }
        	});
        });


		
		$("#test_btn").click(function(){
				alert("测试开始");
				$.ajax({
						url: "/mosquito/ajaxtest",
						dataType: "json",
						type: "get",
						success: function(res){
								wx.onMenuShareTimeline({
				            	title: res.message,
				        	    link: 'http://wx.zhishimama.com', // 分享链接
				        	    imgUrl: 'http://wx.zhishimama.com/wenzi/img/sharelog.jpeg', // 分享图标
				        	    success: function () {
				            	    $.ajax({
											url: "",
				                	    });
				            	    
				        	    },
				        	    cancel: function () {
				        	        // 用户取消分享后执行的回调函数
				        	        alert("用户自己取消");
				        	    }
				        	});


							wx.onMenuShareAppMessage({
								title: res.message,
				        	    link: 'http://wx.zhishimama.com', // 分享链接
				        	    imgUrl: 'http://wx.zhishimama.com/wenzi/img/sharelog.jpeg', // 分享图标
				        	    type: 'link', // 分享类型,music、video或link，不填默认为link
				        	    dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
				        	    success: function () {
				        	    },
				        	    cancel: function () {
				        	        // 用户取消分享后执行的回调函数
				        	    	alert("用户自己取消");
				        	    }
				        	});
								
					        	
							}
					});
		});
        	
    })
	</script>
</body>
</html>